﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using System.Collections.Specialized;

public partial class detail : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        NameValueCollection args = Request.QueryString;
        if (args != null)
        {
            CreateTable(args["id"]);
        }
    }

    private void CreateTable(string strid)
    {

        string sql = string.Format("SELECT * FROM [follow] as f, [userinfo] as u where f.u_id = u.u_id and f.p_id = {0}",strid);

        ManageData md = new ManageData(util.DATACONNECTION);
        string strMsg = string.Empty;

        

        if (md != null)
        {
            DataSet ds = md.ExecDS(sql);

            if (ds != null && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0)
            {
                for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
                {
                    strMsg += "<tr style='vertical-align: text-top; text-align: center'>";

                    strMsg += string.Format(@"<td height='15px' style='font-family: 宋体; font-size: small'>{0}
                                              </td><td height='15px' style='font-family: 宋体; font-size: small'>
                                                      {1}</td><td height='15px' style='font-family: 宋体; font-size: small'>{2}</td>",
                                                                   ds.Tables[0].Rows[i]["f_ctdt"],
                                                                   ds.Tables[0].Rows[i]["u_show"],
                                                                   ds.Tables[0].Rows[i]["f_descation"]);

                    strMsg += "</tr>";
                }
            }
            else
            {
                strMsg += "<tr style='vertical-align: text-top; text-align: center'>";

                strMsg += string.Format(@"<td height='15px' style='font-family: 宋体; font-size: small'>{0}</td>",
                                                              "暂无相关信息"
                                                              );

                strMsg += "</tr>";
            }
        }
      
        Literal1.Text = strMsg;
                  
    }
}
